'''
Created on 2012-3-26
该类主要 演示了python读取文件的方法
@author: yase nagat
'''
       
class FileUtil:
    
    '''文件操作类'''
    
    '''初始化'''
    def __init__(self,path):
        self.path = path
    
    def write(self,content):
        f = open(self.path,'a',encoding='utf-8')
        f.write(content)
        f.close()
    
    def read(self):
        f = open(self.path,'r',encoding='utf-8')
        
        while True:
            content = f.readline()
            if len(content) == 0 :
                break
            print(content)
            
            

###测试***********************************************************

#fu = FileUtil("a")
#fu.write('o(∩_∩)o 哈哈\t')
##fu.write("Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most platforms.");
#fu.read()



